<?php

class SettingAction extends Action{
	public function index(){
		$m = M('info');
		$list = $m->find(1);
		//print_r($list);
		$this->assign('info',$list);
		$this->display();

	}

	public function add(){
		$m = M('info');
		if($m->find(1)){
			if($m->where('1')->save()){
				$this->success('更新成功!');
			}else{
				$this->error('设置失败!');
			}
		}else{
			if($m->insert()){
				$this->success('设置成功');
			}else{
				$this->error('设置失败!');
			}
		}
	}
}
